#define _CRT_SECURE_NO_WARNINGS 1

#include "singleton_pattern.h"
#include <iostream>

using namespace std;

void testNormal()
{
	ChocolateBoiler ChocolateBoiler_1;
	ChocolateBoiler_1.fill();
	ChocolateBoiler_1.boil();
	ChocolateBoiler_1.drain();

	cout << "ChocolateBoiler No1:" << &ChocolateBoiler_1 << endl;
	cout << "-----------------------------------------" << endl;

	ChocolateBoiler ChocolateBoiler_2;
	ChocolateBoiler_2.fill();
	ChocolateBoiler_2.boil();
	ChocolateBoiler_2.drain();
	cout << "ChocolateBoiler No2:" << &ChocolateBoiler_2 << endl;
	cout << "-----------------------------------------" << endl;

	if (&ChocolateBoiler_1 == &ChocolateBoiler_2) {
		cout << "The same ChocolateBoiler, everything's OK!" << endl;
	}
	else {
		cout << "FUCK! The chocolate spilled!" << endl;
	}
}

void testSingleton()
{
	ChocolateBoilerSingleton* ChocolateBoiler_1 = ChocolateBoilerSingleton::getChocolateBoiler();
	ChocolateBoiler_1->fill();
	ChocolateBoiler_1->boil();
	ChocolateBoiler_1->drain();

	cout << "ChocolateBoiler No1:" << ChocolateBoiler_1 << endl;
	cout << "-----------------------------------------" << endl;

	ChocolateBoilerSingleton* ChocolateBoiler_2 = ChocolateBoilerSingleton::getChocolateBoiler();
	ChocolateBoiler_2->fill();
	ChocolateBoiler_2->boil();
	ChocolateBoiler_2->drain();
	cout << "ChocolateBoiler No2:" << ChocolateBoiler_2 << endl;
	cout << "-----------------------------------------" << endl;

	if (ChocolateBoiler_1 == ChocolateBoiler_2) {
		cout << "The same ChocolateBoiler, everything's OK!" << endl;
	}
	else {
		cout << "FUCK! The chocolate spilled!" << endl;
	}
}

int main()
{
	//testNormal();
	testSingleton();
	return 0;
}